#include <stdlib.h>
#include "curseur.h"
#include "disposition.h"


void curInit(curseur *cCur)
{
	cCur->x = 1;
	cCur->y = 1;
}

void curGauche(curseur *cCur, const dispo *cdis)
{
	if (dispEstPositioncursValide( cdis, cCur->x-1, cCur->y))
		cCur->x--;
}

void curDroite(curseur *cCur, const dispo *cdis)
{
	if (dispEstPositioncursValide( cdis, cCur->x+1, cCur->y))
		cCur->x++;
}

void curHaut(curseur *cCur, const dispo *cdis)
{
	if (dispEstPositioncursValide( cdis, cCur->x, cCur->y-1))
		cCur->y--;
}

void curBas(curseur *cCur, const dispo *cdis)
{
	if (dispEstPositioncursValide( cdis, cCur->x, cCur->y+1))
		cCur->y++;
}

int curGetX(const curseur *cCur)
{
	return cCur->x;
}

int curGetY(const curseur *cCur)
{
	return cCur->y;
}
